#include <iostream>
#include <fstream>
#include <string>

using namespace std;


int main()
{
  /*
  FILE* fout = fopen("index.dat","wb");
  int onedata = 12;
  fwrite(&onedata,sizeof(int),1,fout);
  //fseek(fin, 0, SEEK_END);
  
  onedata = 13;
  fwrite(&onedata,sizeof(int),1,fout);
  onedata = 14;
  fwrite(&onedata,sizeof(int),1,fout);
  
  fclose(fout);
  */
  /*
  //int size[3] ;
  int size;
  ifstream fin("index.dat",ifstream::in);
  
  fin.read((char*)&size,sizeof(int));
  cout<<size<<endl;

  fin.read((char*)&size,sizeof(int));
  cout<<size<<endl;
  fin.read((char*)&size,sizeof(int));
  cout<<size<<endl;

  fin.close();
  */

  FILE* fin = fopen("index.dat","rb");
  int buf[3];
  //  fseek(fin,sizeof(4),SEEK_SET);
  fread((char*)buf,sizeof(int),3,fin);
  cout<<buf[0]<<endl;
  cout<<buf[1]<<endl;
  cout<<buf[2]<<endl;
  /*
  fread((char*)&buf,sizeof(int),1,fin);
  cout<<buf<<endl;
  fread((char*)&buf,sizeof(int),1,fin);
  cout<<buf<<endl;
  */
  fclose(fin);

  return 0;
}
